<template>
  <view class="container">
    <scroll-view scroll-y="true" class="scroll-box">
      <view class="title" :style="flag ? {marginTop: '180rpx'} : ''">
        水果医生<text class="f">(Fruit doctor)</text>
      </view>
      <view class="top-box">

      </view>
      <view class="bottom-box">
        <text class="his" @click="goHistory">
          历史记录
        </text>
        <view class="main">
          <view class="img-box" @tap="goCamera">
            <image src="../../static/index/camera.png" alt="" />
          </view>
          <text class="pai">拍照识别水果病虫害</text>
        </view>
      </view>
      <view class="footer">
        <image src="../../static/index/bell.png" mode=""></image>
        <text>欢迎使用水果医生，为您的水果保驾护航！</text>
      </view>
    </scroll-view>
  </view>

</template>

<script setup>
  import {computed} from "vue"
  const flag = computed(() => {
    return getApp().globalData.isIphoneX;
  })
 const goHistory = () => {
   uni.switchTab({
   	url: '/pages/history/history'
   });
 }
  const goCamera = () => {
    uni.navigateTo({
      url: "/pages/camera/camera"
    })
  }
</script>

<style scoped lang="scss">
  .scroll-box {
    height: 100vh;
    background-color: #F6F7FB;
  }

  .top-box {
    height: 300rpx;
    background-image: url();
    background-size: cover;
    // margin-top: 190rpx;

  }

  .title {
    height: 100rpx;
    margin-top: 110rpx;
    padding-left: 30rpx;
    font-size: 40rpx;
    font-weight: 550;

    .f {
      font-size: 34rpx;
    }

    background-color: #fff;
  }

  .bottom-box {
    position: relative;
    width: 93%;
    height: 430rpx;
    margin: 20rpx auto 0;
    border: 2rpx solid #ccc;
    border-radius: 70rpx;
    background-color: #BBDDF8;

    .his {
      position: absolute;
      top: -2rpx;
      right: 0;
      color: white;
      padding: 10rpx 75rpx 15rpx;
      font-size: 42rpx;
      font-weight: 600;
      background-color: #3F81C1;
      border: 1rpx solid #ccc;
      border-radius: 100rpx;
    }

    .main {
      margin-top: 65rpx;
      padding-left: 35rpx;
      display: flex;
      align-items: center;

      .img-box {
        width: 300rpx;
        height: 300rpx;

        image {
          width: 100%;
          height: 100%;
        }
      }

      .pai {
        position: relative;
        top: 70rpx;
        color: #3F81C1;
        font-weight: 550;
        font-size: 36rpx;
      }
    }

  }

  .footer {
    border: 1px solid #ccc;
    border-radius: 15rpx;
    width: 700rpx;
    margin: 30rpx auto 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 60rpx;
    padding-left: 20rpx;
    background-color: #FFF6D9;

    image {
      width: 40rpx;
      height: 40rpx;
    }

    text {
      margin-left: 10rpx;
      color: #EEA45E;
    }
  }
</style>
